#include <stdio.h>  
  
int main() {  
    int num1, num2, cnt;  
    while (1) {  
        cnt = 0;  
        if (scanf("%d%d", &num1, &num2));  
        if (num1 == 0 || num2 == 0)  
            break;  
        if (num1 < 1000 || num2 < 1000) {  
            printf("Error\n");  
            continue;  
        }  
        if (num1 > num2) {  
            printf("Error\n");  
            continue;  
        }  
        for (int i = num1 % 2 ? num1 + 1 : num1; i <= num2; i += 2) {  
            if (i % 10 != i / 10 % 10 && i % 10 != i / 100 % 10 && i % 10 != i / 1000 % 10 &&  
                    i / 10 % 10 != i / 100 % 10 && i / 10 % 10 != i / 1000 % 10 &&  
                    i / 100 % 10 != i / 1000 % 10) {  
                printf("%d  ", i);  
                cnt++;  
            }  
        }  
        printf("\n");  
        printf("counter=%d\n", cnt);  
    }  
    return 0;  
}  